#pragma once

#include <QtCore/QMap>
class DElement;

//Singleton Pattern with destroy method
class DElementDelegate
{
public:
	static DElementDelegate* instance();
	static void destroy() { 
		if (_instance) delete _instance; 
		_instance = 0;
	}
	void registerDElement(DElement* de);
	DElement* find(const QString& kind, const QString& className);

private:
	DElementDelegate() {}
	~DElementDelegate() {}

	static DElementDelegate* _instance;
	QMap<QString, DElement*> mActors;
	QMap<QString, DElement*> mRouters;
	QMap<QString, DElement*> mPools;
	QMap<QString, DElement*> mComposites;
};
